﻿using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using ShrinkWrap.HttpHandler;
using System.Web;

namespace ShrinkWrap.Test.HttpHandler
{
    [TestFixture]
    class HttpResponseWrapperFixture
    {
        [TestCase()]
        public void TestGettingAndSetting()
        {
            var response = new HttpResponse(null);
            var responseWrapper = new HttpResponseWrapper(response)
            {
                StatusCode = 33,
                ContentType = "foo",
            };

            Assert.AreEqual(33, responseWrapper.StatusCode);
            Assert.AreEqual("foo", responseWrapper.ContentType);
        }
        [TestCase()]
        public void TestWriting()
        {
            var output = new StringWriter();
            var responseWrapper = new HttpResponseWrapper(new HttpResponse(output));

            responseWrapper.Write("Hello world!");

            Assert.AreEqual("Hello world!", output.ToString());
        }
    }
}
